package com.mzw.mzwinterface.controller;

import com.mzw.mzwclientsdk.model.Message;
import com.mzw.mzwclientsdk.model.User;
import com.mzw.mzwclientsdk.utils.SignUtils;
import com.yupi.yucongming.dev.client.YuCongMingClient;
import com.yupi.yucongming.dev.common.BaseResponse;
import com.yupi.yucongming.dev.model.DevChatRequest;
import com.yupi.yucongming.dev.model.DevChatResponse;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;


/**
 * 名称API
 *
 * @author L1nAn
 */
@RestController
@RequestMapping("/name")
public class NameController {

    @GetMapping("/get")
    public String getNameByGet(String name, HttpServletRequest request) {
        System.out.println(request.getHeader("mzw"));
        return "Get 你的名字是" + name;
    }
    @PostMapping("/post")
    public String getNameByPost(@RequestBody String name) {
        return "POST 你的名字是" + name;
    }

    // 测试接口
    @PostMapping("/user")
    public String getUsernameByPost(@RequestBody User user, HttpServletRequest request) {
        String result = "POST 用户名字是" + user.getUsername();
        return result;
    }
}
